// pages/event/event.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    num: 0,
    i: 0,
    i2:0,
    arr: [100, 200, 300, 400],
    img:["01.png","02.png","03.png"],
    items: [{
        name: "CHN",
        value: "中国",
        checked: true
      },
      {
        name: "USA",
        value: "美国"
      },
      {
        name: "JPN",
        value: "日本"
      },
      {
        name: "BRA",
        value: "巴西"
      }
    ]
  },
  onLoad(options){
    console.log(options);
  },
  doClick(e) {
    console.log(e);
  },
  tabBox1() {
    console.log("box1");
  },
  tabBox2() {
    console.log("box2");
  },

  tabBox3() {
    console.log("box3");
  },
  getUserInfo(e) {
    // console.log(e);
    this.setData({
      user: e.detail.userInfo
    });
  },
  getUserInfo2(e) {
    console.log(this);
    wx.getUserProfile({
      desc: '获取用户信息',
      success: res => {
        console.log(this);
        this.setData({
          userInfo: res.userInfo
        });
      }
    })
  },
  doParam(e) {
    console.log(e.currentTarget.dataset.haha);
  },
  doParam2(e) {
    console.log(e);
  },
  doInput(e) {
    // console.log(e.detail.value);
    this.setData({
      username: e.detail.value
    });
  },
  doCheckbox(e) {
    console.log(e);
  },
  doPicker(e) {
    this.setData({
      index: e.detail.value
    });
  },
  doAdd(e) {
    this.setData({
      num: this.data.num + 1
    });
  },
  doMinus() {
    if (this.data.num > 0) {
      this.setData({
        num: this.data.num - 1
      });
    }

  },
  doArr() {

    
      this.setData({
        i: this.data.i + 1
      });
      if(this.data.i==4){
        this.setData({
          i:0
        });
      }
 

  },
  doSelect(e){
    this.setData({
      i2:e.detail.value
    });
  }


})